const Child = (props) => {
  // 点赞
  const handleClick = () => {
    props.updateLikeCount(props.id, props.likeCount + 1)
  }
  return (
    <div className="child">
      <h3>{props.title}</h3>
      <div className="detail">
        <span>{props.author}</span>
        <span>{props.likeCount}点赞</span>
        <span onClick={handleClick}>点赞+1</span>
      </div>
    </div>
  );
};

export default Child;
